﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace nSin
{
    /// <summary>
    /// Interaction logic for Report.xaml
    /// </summary>
    public partial class Report : Window
    {
        public Report()
        {
            InitializeComponent();
            this.reportViewer1 = new Microsoft.Reporting.WinForms.ReportViewer();
            // 
            // reportViewer1
            // 
            this.reportViewer1.Location = new System.Drawing.Point(0, 2);
            this.reportViewer1.Name = "reportViewer1";
            this.reportViewer1.Size = new System.Drawing.Size(400, 250);
            this.reportViewer1.TabIndex = 0;
            this.reportViewer1.LocalReport.ReportEmbeddedResource = "nSin.UtentiReport.rdlc";
            this.nSynDBDataSet = new nSin.nSynDBDataSet();
            UtentiBindingSource = new System.Windows.Forms.BindingSource();
            this.windowsFormsHost1.Child = reportViewer1;


        }

        private Microsoft.Reporting.WinForms.ReportViewer reportViewer1;
        private System.Windows.Forms.BindingSource UtentiBindingSource;
        private nSynDBDataSet nSynDBDataSet;


        private void windowsFormsHost1_ChildChanged(object sender, System.Windows.Forms.Integration.ChildChangedEventArgs e)
        {
            //UtentiBindingSource.DataSource
            //Microsoft.Reporting.WinForms.ReportDataSource m
            nSynDBDataSetTableAdapters.UtentiTableAdapter myTableAdapter = new nSin.nSynDBDataSetTableAdapters.UtentiTableAdapter();
            //nSynDBDataSet.UtentiDataTable myTable = new nSynDBDataSet.UtentiDataTable();
            myTableAdapter.Fill(nSynDBDataSet.Utenti);
            this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("nSynDBDataSet_Utenti", nSynDBDataSet.Utenti));
            this.reportViewer1.RefreshReport();
            reportViewer1.Show();

        }
    }
}
